package iscript.coreFramework.util
{
	import flash.utils.ByteArray;
	import flash.utils.Dictionary;

	public final class CloneHelper {
		
		/**
		 *
		 * @param dictionary
		 * @return
		 */
		static public function cloneDictionary(source:Dictionary):Dictionary {
			var clonedata:Dictionary = new Dictionary();
			for (var item:* in source) {
				clonedata[item] = source[item];
			}
			return clonedata;
		}
		
		static public function object(source:Object):*{
			var byte:ByteArray=new ByteArray(); 
				byte.writeObject(source); 
				byte.position=0; 
			    return byte.readObject(); 
			}
		
	}
}